package com.gz.steak.modules.system.mapper;

import com.gz.steak.modules.system.pojo.dataobject.SysDept;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SysDeptMapper {

    List<SysDept> get();

    int insertSelective(SysDept record);

    @Select("select count(sys_dept.dept_name) from sys_dept where dept_parent_id = #{nodeId}")
    int getCountById(Long nodeId);

    int deleteByPrimaryKey(Long id);

    @Delete("delete from sys_dept where id = #{id} or dept_parent_id = #{id}")
    int deleteByParentId(Long id);

    int updateByPrimaryKeySelective(SysDept sysDept);
}